class PostReqByUsers extends PostsReq{

  String _username;

  PostReqByUsers(Blog blog, String url, String username):super(blog,url){
	_username = username;
  }

	void loadNextPage(Queue nextPage){
	  String lastID = _blog.getLastID();
      if(lastID == null){
		window.alert("ERROR in loadNextPage: lastID == null");
     	  return;
	  }
		String params = "?getpostsbyuser=$_username&id=$lastID";
		getPostsFromServer("GET", params, null, nextPage);
	}
	
	void loadPrevPage(Queue prevPage){
	  String firstID = _blog.getFirstID();
      if(firstID == null){
		  window.alert("ERROR in loadPrevPage: firstID == null");
     	  return;
	  }
		String params = "?getpostsbyuser=$_username&prev=true&id=$firstID";
		getPostsFromServer("GET", params, null, prevPage);
	}
	
	void loadCurrPage(Queue currPage){
		String params = "?getpostsbyuser=$_username";
		getPostsFromServer("GET", params, null, currPage);
	}
  
}
